package com.uduemc.biso.master.backend.service;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.github.pagehelper.PageInfo;
import com.uduemc.biso.core.common.extities.CMasterUserData;
import com.uduemc.biso.core.extities.center.MasterUser;
import com.uduemc.biso.master.backend.request.MastermanageAppend;

public interface MastermanageService {

	/**
	 * 通过 id 获取 MasterUser 数据
	 * 
	 * @param username
	 * @return
	 * @throws IOException
	 * @throws JsonProcessingException
	 * @throws JsonMappingException
	 * @throws JsonParseException
	 */
	public MasterUser getById(long id)
			throws JsonParseException, JsonMappingException, JsonProcessingException, IOException;

	/**
	 * 通过用户名 username 获取 MasterUser 数据
	 * 
	 * @param username
	 * @return
	 * @throws IOException
	 * @throws JsonProcessingException
	 * @throws JsonMappingException
	 * @throws JsonParseException
	 */
	public MasterUser getByUsername(String username)
			throws JsonParseException, JsonMappingException, JsonProcessingException, IOException;

	/**
	 * 通过 mastermanageAppend 写入 MasterUser 数据
	 * 
	 * @param mastermanageAppend
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws JsonProcessingException
	 * @throws IOException
	 */
	public MasterUser userAppend(MastermanageAppend mastermanageAppend)
			throws JsonParseException, JsonMappingException, JsonProcessingException, IOException;

	/**
	 * 通过参数获取列表数据
	 * 
	 * @param username
	 * @param status
	 * @param loginNode
	 * @param pageNumber
	 * @param orderByString
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws JsonProcessingException
	 * @throws IOException
	 */
	public PageInfo<CMasterUserData> userInfos(String username, short status, short loginNode, int pageNumber,
			String orderByString) throws JsonParseException, JsonMappingException, JsonProcessingException, IOException;

	/**
	 * 通过数据对象中id 更新 masterUser 数据
	 * 
	 * @param masterUser
	 * @return
	 * @throws JsonParseException
	 * @throws JsonMappingException
	 * @throws JsonProcessingException
	 * @throws IOException
	 */
	public MasterUser updateById(MasterUser masterUser)
			throws JsonParseException, JsonMappingException, JsonProcessingException, IOException;

}
